package com.cicc.springboot.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cicc.springboot.common.dto.R;
import com.cicc.springboot.entity.GoodsEntity;
import com.cicc.springboot.model.GoodsQuery;
import com.cicc.springboot.service.GoodsService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 仅测试使用
 */
@RestController
@RequestMapping("/goods")
@AllArgsConstructor
public class GoodsController {

    private final GoodsService goodsService;

    @GetMapping
    public R<Page<GoodsEntity>> listPage(GoodsQuery query) {
        goodsService.lambdaQuery().page(query);
        return R.ok(query);
    }
}
